<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
                      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
    <title>The UserAgent Storage Interface - Zend Framework Manual</title>

    <link href="../css/shCore.css" rel="stylesheet" type="text/css" />
    <link href="../css/shThemeDefault.css" rel="stylesheet" type="text/css" />
    <link href="../css/styles.css" media="all" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>Zend Framework</h1>
<h2>Programmer's Reference Guide</h2>
<ul>
    <li><a href="../en/zend.http.user-agent-storage.html">Inglês (English)</a></li>
    <li><a href="../pt-br/zend.http.user-agent-storage.html">Português Brasileiro (Brazilian Portuguese)</a></li>
</ul>
<table width="100%">
    <tr valign="top">
        <td width="85%">
            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.http.user-agent-features-tera-wurfl.html">The TeraWurfl UserAgent Features Adapter</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.http.html">Zend_Http</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.http.user-agent-storage-session.html">The Session UserAgent Storage Adapter</a></div>
                    </td>
                </tr>
            </table>
<hr />
<div id="zend.http.user-agent-storage" class="section"><div class="info"><h1 class="title">The UserAgent Storage Interface</h1></div>
    

    <div class="section" id="zend.http.user-agent-storage.intro"><div class="info"><h1 class="title">Overview</h1></div>
        

        <p class="para">
            Because discovering and identifying mobile device capabilities can involve a number of
            resources, it&#039;s often useful to identify the capabilities on the first visit, and cache
            it for subsequent visits.
        </p>

        <p class="para">
            The <span class="interfacename">Zend_Http_UserAgent_Storage</span> interface provides a
            simple definition for defining storage adapters capable of persisting definitions. By
            default, a <span class="classname">Session</span> storage adapter is used, which persists the
            data in a <span class="classname">Zend_Session_Namespace</span> instance.
        </p>
    </div>

    <div class="section" id="zend.http.user-agent-storage.quick-start"><div class="info"><h1 class="title">Quick Start</h1></div>
        

        <p class="para">
            The interface provides simply the ability to read from, write to, test for, and clear
            data in the persistence backend.
        </p>

        <pre class="programlisting brush: php">
interface Zend_Http_UserAgent_Storage
{
    public function isEmpty();
    public function read();
    public function write($contents);
    public function clear();
}
</pre>


        <p class="para">
            By default, the <span class="classname">Zend_Http_UserAgent_Storage_Session</span> adapter is
            utilized. That adapter writes to a unique <span class="classname">Zend_Session_Namespace</span>
            for the given user.
        </p>
    </div>

    <div class="section" id="zend.http.user-agent-storage.options"><div class="info"><h1 class="title">Configuration Options</h1></div>
        

        <p class="para">
            See the individual storage adapters for configuration options. Most adapters will accept
            an array or object as an argument to the constructor, and the
            <span class="classname">UserAgent</span> class allows passing an array of options.
        </p>
    </div>

    <div class="section" id="zend.http.user-agent-storage.methods"><div class="info"><h1 class="title">Available Methods</h1></div>
        

        <dl>

            <dt id="zend.view.helpers.initial.tiny-src.methods.is-empty">
                <dt class="term">
                    <div class="methodsynopsis dc-description">
                         <span class="methodname">isEmpty</span>
                    </div>

                </dt>

                <dd>

                    <p class="para">
                        Test whether ornot the storage adapter has an entry. Returns true if the
                        storage is currently unpopulated.
                    </p>
                </dd>

            </dt>


            <dt id="zend.view.helpers.initial.tiny-src.methods.read">
                <dt class="term">
                    <div class="methodsynopsis dc-description">
                         <span class="methodname">read</span>
                    </div>

                </dt>

                <dd>

                    <p class="para">
                        Reads data from storage; the data will be serialized PHP.
                    </p>
                </dd>

            </dt>


            <dt id="zend.view.helpers.initial.tiny-src.methods.write">
                <dt class="term">
                    <div class="methodsynopsis dc-description">
                         <span class="methodname">write</span>
                        <span class="methodparam">( 
                            <code_funcparams class="funcparams">$contents</code_funcparams>
                         )</span>
                    </div>

                </dt>

                <dd>

                    <p class="para">
                        Write a serialized string to the storage engine.
                    </p>
                </dd>

            </dt>


            <dt id="zend.view.helpers.initial.tiny-src.methods.clear">
                <dt class="term">
                    <div class="methodsynopsis dc-description">
                         <span class="methodname">clear</span>
                    </div>

                </dt>

                <dd>

                    <p class="para">
                        Should empty the storage; calling  <span class="methodname">isEmpty()</span> following a
                         <span class="methodname">clear()</span> operation should return
                        <b><tt>true</tt></b>.
                    </p>
                </dd>

            </dt>

        </dl>

    </div>
</div>
        <hr />

            <table width="100%">
                <tr>
                    <td width="25%" style="text-align: left;">
                    <a href="zend.http.user-agent-features-tera-wurfl.html">The TeraWurfl UserAgent Features Adapter</a>
                    </td>

                    <td width="50%" style="text-align: center;">
                        <div class="up"><span class="up"><a href="zend.http.html">Zend_Http</a></span><br />
                        <span class="home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></span></div>
                    </td>

                    <td width="25%" style="text-align: right;">
                        <div class="next" style="text-align: right; float: right;"><a href="zend.http.user-agent-storage-session.html">The Session UserAgent Storage Adapter</a></div>
                    </td>
                </tr>
            </table>
</td>
        <td style="font-size: smaller;" width="15%"> <style type="text/css">
#leftbar {
	float: left;
	width: 186px;
	padding: 5px;
	font-size: smaller;
}
ul.toc {
	margin: 0px 5px 5px 5px;
	padding: 0px;
}
ul.toc li {
	font-size: 85%;
	margin: 1px 0 1px 1px;
	padding: 1px 0 1px 11px;
	list-style-type: none;
	background-repeat: no-repeat;
	background-position: center left;
}
ul.toc li.header {
	font-size: 115%;
	padding: 5px 0px 5px 11px;
	border-bottom: 1px solid #cccccc;
	margin-bottom: 5px;
}
ul.toc li.active {
	font-weight: bold;
}
ul.toc li a {
	text-decoration: none;
}
ul.toc li a:hover {
	text-decoration: underline;
}
</style>
 <ul class="toc">
  <li class="header home"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="manual.html">Guia de Refer&ecirc;ncia do Programador</a></li>
  <li class="header up"><a href="reference.html">Refer&ecirc;ncia do Zend Framework</a></li>
  <li class="header up"><a href="zend.http.html">Zend_Http</a></li>
  <li><a href="zend.http.client.html">Introduction</a></li>
  <li><a href="zend.http.client.advanced.html">Zend_Http_Client - Advanced Usage</a></li>
  <li><a href="zend.http.client.adapters.html">Zend_Http_Client - Connection Adapters</a></li>
  <li><a href="zend.http.cookies.html">Zend_Http_Cookie and Zend_Http_CookieJar</a></li>
  <li><a href="zend.http.response.html">Zend_Http_Response</a></li>
  <li><a href="zend.http.user-agent.html">Zend_Http_UserAgent</a></li>
  <li><a href="zend.http.user-agent-device.html">The UserAgent Device Interface</a></li>
  <li><a href="zend.http.user-agent-features.html">The UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-features-wurfl.html">The WURFL UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-features-device-atlas.html">The DeviceAtlas UserAgent Features Adapter</a></li>
  <li><a href="zend.http.user-agent-features-tera-wurfl.html">The TeraWurfl UserAgent Features Adapter</a></li>
  <li class="active"><a href="zend.http.user-agent-storage.html">The UserAgent Storage Interface</a></li>
  <li><a href="zend.http.user-agent-storage-session.html">The Session UserAgent Storage Adapter</a></li>
 </ul>
 </td>
    </tr>
</table>

<script type="text/javascript" src="../js/shCore.js"></script>
<script type="text/javascript" src="../js/shAutoloader.js"></script>
<script type="text/javascript" src="../js/main.js"></script>

</body>
</html>